package com.codergd.gra.controller;

import com.codergd.gra.bean.Job;
import com.codergd.gra.bean.Orders;
import com.codergd.gra.service.OrderService;
import com.codergd.gra.vo.ComFive;
import com.codergd.gra.vo.JobFive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/orders")
public class OrderController {
    @Autowired
    OrderService orderService;

    @PostMapping("/insert")
    public int insertOrder(Orders orders){
        return orderService.insertOrder(orders);
    }

    //充钱最狠的的公司
    @PostMapping("/selectCom")
    public List<ComFive> selectCom(){
//        System.out.println(orderService.selectCom());
        return orderService.selectCom();
    }

    //充钱最狠的职位
    @PostMapping("/selectJob")
    public List<Job> selectJob(){
        return orderService.selectJob();
    }

    //投递最多的职位
    @PostMapping("/selectJob1")
    public List<JobFive> selectJob1(){
        return orderService.selectJob1();
    }
}
